package com.code9xs.controller;

import com.code9xs.util.MailClient;
import com.code9xs.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * @author Suhd
 * @date 2021/4/25
 * @time 11:30
 * @wechat i9xswanan
 * @github https://github.com/Code9xs
 */
@RestController
public class TestController {
    @Autowired
    MailClient mailClient;

    @GetMapping("/test")
    public Result test(){
        HashMap<String, String> map = new HashMap<>();
        map.put("name","苏浩东");
        return Result.succ(map);
    }

    @PostMapping("/sendMsg")
    public boolean serMsg(){
        return mailClient.sendMail("1457382262@qq.com","test","test");
    }
}
